<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html xmlns:yui="http://yuilibrary.com/rdf/1.0/yui.rdf#">
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
	<title>API: yui  Queue   (YUI Library)</title>

	<link rel="stylesheet" type="text/css" href="assets/reset-fonts-grids-min.css" />
	<link rel="stylesheet" type="text/css" href="assets/api.css" />

    <script type="text/javascript" src="assets/api-js"></script>
    <script type="text/javascript" src="assets/ac-js"></script>
</head>

<body id="yahoo-com">

<div id="doc3" class="yui-t2">
	<div id="hd">
        <h1><a href="http://developer.yahoo.com/yui/" title="Yahoo! UI Library">Yahoo! UI Library</a></h1>
        <h3>yui&nbsp; <span class="subtitle">3.1.1</span></h3>
        <a href="./index.html" title="Yahoo! UI Library">Yahoo! UI Library</a> 
            &gt; <a href="./module_yui.html" title="yui">yui</a>
                 &gt; Queue 
                
        <form onsubmit="return false">
            <div id="propertysearch">
                Search: <input autocomplete="off" id="searchinput" />
                <div id="searchresults">
                    &nbsp;
                </div>
            </div>
        </form>
	</div>

	<div id="bd">
		<div id="yui-main">
			<div class="yui-b">
            <form action="#" name="yui-classopts-form" method="get" id="yui-classopts-form">
                <fieldset>
                    <legend>Filters</legend>
                <span class="classopts"><input type="checkbox" name="show_private" id="show_private" /> <label for="show_private">Show Private</label></span>
                <span class="classopts"><input type="checkbox" name="show_protected" id="show_protected" /> <label for="show_protected">Show Protected</label></span>
                <span class="classopts"><input type="checkbox" name="show_deprecated" id="show_deprecated" /> <label for="show_deprecated">Show Deprecated</label></span>
                </fieldset>
            </form>

                    <h2>
                        

                        
                        
                            Class <b property="yui:name">Queue</b>
                        <span class="extends">
                        </span>

                    </h2>
                    <!-- class tree goes here -->
                    
                
  

                    <div class="summary description" property="yui:description">
                        A simple FIFO queue.  Items are added to the Queue with add(1..n items) and
removed using next().
                    </div>

                    
                    <div rel="yui:properties" resource="#properties">
                        <div class="section field details">
                            <h3 id="properties">Properties</h3>
                            <div class="content">
                                    <div class="protected" rel="yui:property" resource="#property__q">
                                    <h4><a name="property__q" property="yui:name">_q</a>
                                        - <code>protected <span property="yui:type">{Array}</span></code>
                                    </h4>
                                    <div class="detail">
                                        <div class="description" property="yui:description">
                                            The collection of enqueued items
                                        </div>
                                    </div>
     
                                        


                                    <hr />
                                    </div>
                            </div>
                        </div>

                    </div>

                    <div rel="yui:methods" resource="#methods">
                        <div class="section method details">
                            <h3 id="methods">Methods</h3>
                            <div class="content">
                                    <div class="protected" rel="yui:method" resource="#method__init">
                                    <h4>
                                        <a name="method__init">_init</a></h4>
                                    <div class="detail" >
                                        <code>
                                         protected 
                                        
                                        
                                        void
                                            <strong property="yui:name">_init</strong>
                                           (
                                            )
                                        </code>
                                        
                                        <div class="description" property="yui:description">
                                            Initialize the queue
                                        </div>

                                        <div class="description">




             

                                        </div>

                                    </div>
                                    <hr />
                                    </div>
                                    <div class="" rel="yui:method" resource="#method_add">
                                    <h4>
                                        <a name="method_add">add</a></h4>
                                    <div class="detail" >
                                        <code>
                                        
                                        
                                        
                                        void
                                            <strong property="yui:name">add</strong>
                                           (
                                                
                                                        
                                                         item*
                                                    
                                                
                                            )
                                        </code>
                                        
                                        <div class="description" property="yui:description">
                                            Add 0..n items to the end of the queue
                                        </div>

                                        <div class="description">

                                                <dl rel="yui:parameters">
                                                    <dt>Parameters:</dt>
                                                        <dd rel="yui:parameter">
                                                        <code><span property="yui:name">item*</span>
                                                        &lt;<span property="yui:type">MIXED</span>&gt;
                                                        </code>
                                                        <span property="yui:description">  0..n items</span>
                                                        </dd>
                                                </dl>



             

                                        </div>

                                    </div>
                                    <hr />
                                    </div>
                                    <div class="" rel="yui:method" resource="#method_indexOf">
                                    <h4>
                                        <a name="method_indexOf">indexOf</a></h4>
                                    <div class="detail" >
                                        <code>
                                        
                                        
                                        
                                        Number
                                            <strong property="yui:name">indexOf</strong>
                                           (
                                                
                                                        
                                                         needle
                                                    
                                                
                                            )
                                        </code>
                                        
                                        <div class="description" property="yui:description">
                                            Returns the current index in the queue of the specified item
                                        </div>

                                        <div class="description">

                                                <dl rel="yui:parameters">
                                                    <dt>Parameters:</dt>
                                                        <dd rel="yui:parameter">
                                                        <code><span property="yui:name">needle</span>
                                                        &lt;<span property="yui:type">MIXED</span>&gt;
                                                        </code>
                                                        <span property="yui:description">  the item to search for</span>
                                                        </dd>
                                                </dl>

                                                <dl>
                                                    <dt>Returns:
                                                    <code property="yui:return">
                                                            Number
                                                    </code></dt>
                                                    <dd property="yui:returnInfo">the index of the item or -1 if not found</dd>
                                                </dl>


             

                                        </div>

                                    </div>
                                    <hr />
                                    </div>
                                    <div class="" rel="yui:method" resource="#method_last">
                                    <h4>
                                        <a name="method_last">last</a></h4>
                                    <div class="detail" >
                                        <code>
                                        
                                        
                                        
                                        MIXED
                                            <strong property="yui:name">last</strong>
                                           (
                                            )
                                        </code>
                                        
                                        <div class="description" property="yui:description">
                                            Get the last in the queue. LIFO support
                                        </div>

                                        <div class="description">


                                                <dl>
                                                    <dt>Returns:
                                                    <code property="yui:return">
                                                            MIXED
                                                    </code></dt>
                                                    <dd property="yui:returnInfo">the last item in the queue</dd>
                                                </dl>


             

                                        </div>

                                    </div>
                                    <hr />
                                    </div>
                                    <div class="" rel="yui:method" resource="#method_next">
                                    <h4>
                                        <a name="method_next">next</a></h4>
                                    <div class="detail" >
                                        <code>
                                        
                                        
                                        
                                        MIXED
                                            <strong property="yui:name">next</strong>
                                           (
                                            )
                                        </code>
                                        
                                        <div class="description" property="yui:description">
                                            Get the next item in the queue. FIFO support
                                        </div>

                                        <div class="description">


                                                <dl>
                                                    <dt>Returns:
                                                    <code property="yui:return">
                                                            MIXED
                                                    </code></dt>
                                                    <dd property="yui:returnInfo">the next item in the queue</dd>
                                                </dl>


             

                                        </div>

                                    </div>
                                    <hr />
                                    </div>
                                    <div class="" rel="yui:method" resource="#method_promote">
                                    <h4>
                                        <a name="method_promote">promote</a></h4>
                                    <div class="detail" >
                                        <code>
                                        
                                        
                                        
                                        void
                                            <strong property="yui:name">promote</strong>
                                           (
                                                
                                                        
                                                         item
                                                    
                                                
                                            )
                                        </code>
                                        
                                        <div class="description" property="yui:description">
                                            Moves the referenced item to the head of the queue
                                        </div>

                                        <div class="description">

                                                <dl rel="yui:parameters">
                                                    <dt>Parameters:</dt>
                                                        <dd rel="yui:parameter">
                                                        <code><span property="yui:name">item</span>
                                                        &lt;<span property="yui:type">MIXED</span>&gt;
                                                        </code>
                                                        <span property="yui:description">  an item in the queue</span>
                                                        </dd>
                                                </dl>



             

                                        </div>

                                    </div>
                                    <hr />
                                    </div>
                                    <div class="" rel="yui:method" resource="#method_remove">
                                    <h4>
                                        <a name="method_remove">remove</a></h4>
                                    <div class="detail" >
                                        <code>
                                        
                                        
                                        
                                        void
                                            <strong property="yui:name">remove</strong>
                                           (
                                                
                                                        
                                                         item
                                                    
                                                
                                            )
                                        </code>
                                        
                                        <div class="description" property="yui:description">
                                            Removes the referenced item from the queue
                                        </div>

                                        <div class="description">

                                                <dl rel="yui:parameters">
                                                    <dt>Parameters:</dt>
                                                        <dd rel="yui:parameter">
                                                        <code><span property="yui:name">item</span>
                                                        &lt;<span property="yui:type">MIXED</span>&gt;
                                                        </code>
                                                        <span property="yui:description">  an item in the queue</span>
                                                        </dd>
                                                </dl>



             

                                        </div>

                                    </div>
                                    <hr />
                                    </div>
                                    <div class="" rel="yui:method" resource="#method_size">
                                    <h4>
                                        <a name="method_size">size</a></h4>
                                    <div class="detail" >
                                        <code>
                                        
                                        
                                        
                                        Number
                                            <strong property="yui:name">size</strong>
                                           (
                                            )
                                        </code>
                                        
                                        <div class="description" property="yui:description">
                                            Returns the current number of queued items
                                        </div>

                                        <div class="description">




             

                                        </div>

                                    </div>
                                    <hr />
                                    </div>
                            </div>
                        </div>

                    </div>

                    <div rel="yui:events" resource="#events">


                    </div>

                    <div rel="yui:attributes" resource="#configattributes">

                    </div>

			</div>
		</div>
		<div class="yui-b">
            <div class="nav">

                    <div id="moduleList" class="module">
                        <h4>Modules</h4>
                        <ul class="content">
                                <li class=""><a href="module_align-plugin.html" title="align-plugin">align-plugin</a></li>
                                <li class=""><a href="module_anim.html" title="anim">anim</a></li>
                                <li class=""><a href="module_async-queue.html" title="async-queue">async-queue</a></li>
                                <li class=""><a href="module_attribute.html" title="attribute">attribute</a></li>
                                <li class=""><a href="module_base.html" title="base">base</a></li>
                                <li class=""><a href="module_cache.html" title="cache">cache</a></li>
                                <li class=""><a href="module_classnamemanager.html" title="classnamemanager">classnamemanager</a></li>
                                <li class=""><a href="module_collection.html" title="collection">collection</a></li>
                                <li class=""><a href="module_console.html" title="console">console</a></li>
                                <li class=""><a href="module_console-filters.html" title="console-filters">console-filters</a></li>
                                <li class=""><a href="module_cookie.html" title="cookie">cookie</a></li>
                                <li class=""><a href="module_dataschema.html" title="dataschema">dataschema</a></li>
                                <li class=""><a href="module_datasource.html" title="datasource">datasource</a></li>
                                <li class=""><a href="module_datatype.html" title="datatype">datatype</a></li>
                                <li class=""><a href="module_dd.html" title="dd">dd</a></li>
                                <li class=""><a href="module_dom.html" title="dom">dom</a></li>
                                <li class=""><a href="module_dump.html" title="dump">dump</a></li>
                                <li class=""><a href="module_event.html" title="event">event</a></li>
                                <li class=""><a href="module_event-custom.html" title="event-custom">event-custom</a></li>
                                <li class=""><a href="module_event-simulate.html" title="event-simulate">event-simulate</a></li>
                                <li class=""><a href="module_history.html" title="history">history</a></li>
                                <li class=""><a href="module_imageloader.html" title="imageloader">imageloader</a></li>
                                <li class=""><a href="module_intl.html" title="intl">intl</a></li>
                                <li class=""><a href="module_io.html" title="io">io</a></li>
                                <li class=""><a href="module_json.html" title="json">json</a></li>
                                <li class=""><a href="module_loader.html" title="loader">loader</a></li>
                                <li class=""><a href="module_node.html" title="node">node</a></li>
                                <li class=""><a href="module_node-focusmanager.html" title="node-focusmanager">node-focusmanager</a></li>
                                <li class=""><a href="module_node-menunav.html" title="node-menunav">node-menunav</a></li>
                                <li class=""><a href="module_oop.html" title="oop">oop</a></li>
                                <li class=""><a href="module_overlay.html" title="overlay">overlay</a></li>
                                <li class=""><a href="module_plugin.html" title="plugin">plugin</a></li>
                                <li class=""><a href="module_pluginhost.html" title="pluginhost">pluginhost</a></li>
                                <li class=""><a href="module_profiler.html" title="profiler">profiler</a></li>
                                <li class=""><a href="module_querystring.html" title="querystring">querystring</a></li>
                                <li class=""><a href="module_queue-promote.html" title="queue-promote">queue-promote</a></li>
                                <li class=""><a href="module_shim-plugin.html" title="shim-plugin">shim-plugin</a></li>
                                <li class=""><a href="module_slider.html" title="slider">slider</a></li>
                                <li class=""><a href="module_sortable.html" title="sortable">sortable</a></li>
                                <li class=""><a href="module_stylesheet.html" title="stylesheet">stylesheet</a></li>
                                <li class=""><a href="module_substitute.html" title="substitute">substitute</a></li>
                                <li class=""><a href="module_swf.html" title="swf">swf</a></li>
                                <li class=""><a href="module_swfdetect.html" title="swfdetect">swfdetect</a></li>
                                <li class=""><a href="module_tabview.html" title="tabview">tabview</a></li>
                                <li class=""><a href="module_test.html" title="test">test</a></li>
                                <li class=""><a href="module_widget.html" title="widget">widget</a></li>
                                <li class=""><a href="module_widget-anim.html" title="widget-anim">widget-anim</a></li>
                                <li class=""><a href="module_widget-child.html" title="widget-child">widget-child</a></li>
                                <li class=""><a href="module_widget-locale.html" title="widget-locale">widget-locale</a></li>
                                <li class=""><a href="module_widget-parent.html" title="widget-parent">widget-parent</a></li>
                                <li class=""><a href="module_widget-position.html" title="widget-position">widget-position</a></li>
                                <li class=""><a href="module_widget-position-align.html" title="widget-position-align">widget-position-align</a></li>
                                <li class=""><a href="module_widget-position-constrain.html" title="widget-position-constrain">widget-position-constrain</a></li>
                                <li class=""><a href="module_widget-stack.html" title="widget-stack">widget-stack</a></li>
                                <li class=""><a href="module_widget-stdmod.html" title="widget-stdmod">widget-stdmod</a></li>
                                <li class="selected"><a href="module_yui.html" title="yui">yui</a></li>
                        </ul>
                    </div>

                    <div id="classList" class="module">
                        <h4>Classes</h4>
                        <ul class="content">
                                <li class=""><a href="Array.html" title="Array">Array</a></li>
                                <li class=""><a href="config.html" title="config">config</a></li>
                                <li class=""><a href="Get.html" title="Get">Get</a></li>
                                <li class=""><a href="Intl.html" title="Intl">Intl</a></li>
                                <li class=""><a href="Lang.html" title="Lang">Lang</a></li>
                                <li class=""><a href="Object.html" title="Object">Object</a></li>
                                <li class="selected"><a href="Queue.html" title="Queue">Queue</a></li>
                                <li class=""><a href="UA.html" title="UA">UA</a></li>
                                <li class=""><a href="YUI.html" title="YUI">YUI</a></li>
                        </ul>
                    </div>

                    <div id="fileList" class="module">
                        <h4>Files</h4>
                        <ul class="content">        
                                <li class=""><a href="_module.js.html" title="_module.js">_module.js</a></li>
                                <li class=""><a href="get.js.html" title="get.js">get.js</a></li>
                                <li class=""><a href="intl-base.js.html" title="intl-base.js">intl-base.js</a></li>
                                <li class=""><a href="queue-base.js.html" title="queue-base.js">queue-base.js</a></li>
                                <li class=""><a href="yui-array.js.html" title="yui-array.js">yui-array.js</a></li>
                                <li class=""><a href="yui-base.js.html" title="yui-base.js">yui-base.js</a></li>
                                <li class=""><a href="yui-core.js.html" title="yui-core.js">yui-core.js</a></li>
                                <li class=""><a href="yui-init.js.html" title="yui-init.js">yui-init.js</a></li>
                                <li class=""><a href="yui-lang.js.html" title="yui-lang.js">yui-lang.js</a></li>
                                <li class=""><a href="yui-later.js.html" title="yui-later.js">yui-later.js</a></li>
                                <li class=""><a href="yui-log.js.html" title="yui-log.js">yui-log.js</a></li>
                                <li class=""><a href="yui-object.js.html" title="yui-object.js">yui-object.js</a></li>
                                <li class=""><a href="yui-throttle.js.html" title="yui-throttle.js">yui-throttle.js</a></li>
                                <li class=""><a href="yui-ua.js.html" title="yui-ua.js">yui-ua.js</a></li>
                                <li class=""><a href="yui.js.html" title="yui.js">yui.js</a></li>
                        </ul>
                    </div>

                    <div id="propertyList" class="module">
                        <h4>Properties</h4>
                        <ul class="content">        
                                <li class="protected"><a href="#property__q" title="_q">_q</a></li>
                        </ul>
                    </div>

                    <div id="methodsList" class="module">
                        <h4>Methods</h4>
                        <ul class="content">        
                                <li class="protected"><a href="#method__init" title="_init">_init</a></li>
                                <li class=""><a href="#method_add" title="add">add</a></li>
                                <li class=""><a href="#method_indexOf" title="indexOf">indexOf</a></li>
                                <li class=""><a href="#method_last" title="last">last</a></li>
                                <li class=""><a href="#method_next" title="next">next</a></li>
                                <li class=""><a href="#method_promote" title="promote">promote</a></li>
                                <li class=""><a href="#method_remove" title="remove">remove</a></li>
                                <li class=""><a href="#method_size" title="size">size</a></li>
                        </ul>
                    </div>



            </div>
		</div>
	</div>
	<div id="ft">
        <hr />
        Copyright &copy; 2010 Yahoo! Inc. All rights reserved.
	</div>
</div>
<script type="text/javascript">

    var ALL_YUI_PROPS = [{"access": "", "host": "Get", "name": "abort", "url": "Get.html#method_abort", "type": "method"}, {"access": "", "host": "Intl", "name": "add", "url": "Intl.html#method_add", "type": "method"}, {"access": "", "host": "Queue", "name": "add", "url": "Queue.html#method_add", "type": "method"}, {"access": "private", "host": "Get", "name": "_autoPurge", "url": "Get.html#method__autoPurge", "type": "method"}, {"access": "", "host": "Get", "name": "css", "url": "Get.html#method_css", "type": "method"}, {"access": "private", "host": "Get", "name": "_end", "url": "Get.html#method__end", "type": "method"}, {"access": "private", "host": "Get", "name": "_finalize", "url": "Get.html#method__finalize", "type": "method"}, {"access": "private", "host": "Get", "name": "_finish", "url": "Get.html#method__finish", "type": "method"}, {"access": "", "host": "Intl", "name": "get", "url": "Intl.html#method_get", "type": "method"}, {"access": "", "host": "Intl", "name": "getAvailableLangs", "url": "Intl.html#method_getAvailableLangs", "type": "method"}, {"access": "", "host": "Intl", "name": "getLang", "url": "Intl.html#method_getLang", "type": "method"}, {"access": "", "host": "Queue", "name": "indexOf", "url": "Queue.html#method_indexOf", "type": "method"}, {"access": "protected", "host": "Queue", "name": "_init", "url": "Queue.html#method__init", "type": "method"}, {"access": "", "host": "Intl", "name": "intl:langChange", "url": "Intl.html#event_intl:langChange", "type": "event"}, {"access": "", "host": "Queue", "name": "last", "url": "Queue.html#method_last", "type": "method"}, {"access": "private", "host": "Get", "name": "_linkNode", "url": "Get.html#method__linkNode", "type": "method"}, {"access": "", "host": "Intl", "name": "lookupBestLang", "url": "Intl.html#method_lookupBestLang", "type": "method"}, {"access": "private", "host": "Intl", "name": "_mod", "url": "Intl.html#method__mod", "type": "method"}, {"access": "private", "host": "Get", "name": "_next", "url": "Get.html#method__next", "type": "method"}, {"access": "", "host": "Queue", "name": "next", "url": "Queue.html#method_next", "type": "method"}, {"access": "private", "host": "Get", "name": "_node", "url": "Get.html#method__node", "type": "method"}, {"access": "", "host": "Queue", "name": "promote", "url": "Queue.html#method_promote", "type": "method"}, {"access": "private", "host": "Get", "name": "_purge", "url": "Get.html#method__purge", "type": "method"}, {"access": "private", "host": "Get", "name": "PURGE_THRESH", "url": "Get.html#property_PURGE_THRESH", "type": "property"}, {"access": "private", "host": "Get", "name": "purging", "url": "Get.html#property_purging", "type": "property"}, {"access": "protected", "host": "Queue", "name": "_q", "url": "Queue.html#property__q", "type": "property"}, {"access": "private", "host": "Get", "name": "qidx", "url": "Get.html#property_qidx", "type": "property"}, {"access": "private", "host": "Get", "name": "queue", "url": "Get.html#method_queue", "type": "method"}, {"access": "private", "host": "Get", "name": "queues", "url": "Get.html#property_queues", "type": "property"}, {"access": "", "host": "Queue", "name": "remove", "url": "Queue.html#method_remove", "type": "method"}, {"access": "private", "host": "Get", "name": "_returnData", "url": "Get.html#method__returnData", "type": "method"}, {"access": "", "host": "Get", "name": "script", "url": "Get.html#method_script", "type": "method"}, {"access": "private", "host": "Get", "name": "_scriptNode", "url": "Get.html#method__scriptNode", "type": "method"}, {"access": "", "host": "Intl", "name": "setLang", "url": "Intl.html#method_setLang", "type": "method"}, {"access": "", "host": "Queue", "name": "size", "url": "Queue.html#method_size", "type": "method"}, {"access": "private", "host": "Get", "name": "_timeout", "url": "Get.html#method__timeout", "type": "method"}, {"access": "private", "host": "Get", "name": "_track", "url": "Get.html#method__track", "type": "method"}];
</script>
</body>
</html>
